$OpenBSD: patch-agent_fileutil_fileutil_unix_go,v 1.2 2017/05/28 09:25:31 ajacoutot Exp $
--- agent/fileutil/fileutil_unix.go.orig	Mon Feb 13 21:42:41 2017
+++ agent/fileutil/fileutil_unix.go	Fri Feb 24 09:49:58 2017
@@ -86,14 +86,14 @@ func GetDiskSpaceInfo() (diskSpaceInfo DiskSpaceInfo, 
 	syscall.Statfs(wd, &stat)
 
 	// get block size
-	bSize := uint64(stat.Bsize)
+	bSize := uint64(stat.F_bsize)
 
 	// return DiskSpaceInfo with calculated bytes
 	return DiskSpaceInfo{
 		// On Linux the struct statfs.f_bavail field is unsigned, but on FreeBSD the field is an int64
-		AvailBytes: (int64)((uint64)(stat.Bavail) * bSize), // available space = # of available blocks * block size
-		FreeBytes:  (int64)(stat.Bfree * bSize),            // free space = # of free blocks * block size
-		TotalBytes: (int64)(stat.Blocks * bSize),           // total space = # of total blocks * block size
+		AvailBytes: (int64)((uint64)(stat.F_bavail) * bSize), // available space = # of available blocks * block size
+		FreeBytes:  (int64)(stat.F_bfree * bSize),            // free space = # of free blocks * block size
+		TotalBytes: (int64)(stat.F_blocks * bSize),           // total space = # of total blocks * block size
 	}, nil
 }
 
